//
//  BLSetPassWordController.m
//  Byelone
//
//  Created by 乔小乔 on 2021/1/18.
//

#import "BLSetPassWordController.h"

@interface BLSetPassWordController ()
@property (weak, nonatomic) IBOutlet UIButton *btnSubmit;
@property (weak, nonatomic) IBOutlet UIButton *btnSwitch1;
@property (weak, nonatomic) IBOutlet UITextField *textFieldPass1;
@property (weak, nonatomic) IBOutlet UITextField *textFieldPass2;
@property (weak, nonatomic) IBOutlet UIButton *btnSwitch2;

@end

@implementation BLSetPassWordController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createUI];
}

- (void)viewDidLayoutSubviews{
    [super viewDidLayoutSubviews];
    [self.btnSubmit setGradientBackgroundWithColors:@[[UIColor chColorWithHexString:@"#8881FD"],[UIColor chColorWithHexString:@"#6B71F5"]] locations:@[@(0.0f), @(1.0f)]  startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
}

- (void)createUI{
    NSString *title = @"设置";
    if (self.isReSet) {
        self.textFieldPass1.placeholder = @"请输入新密码";
        self.textFieldPass2.placeholder = @"请确认新密码";
        title = @"重置";
    }
    if (self.passWordType == BLPassWordTypeLogin) {
        title = [NSString stringWithFormat:@"%@登录密码",title];
    }else{
        title = [NSString stringWithFormat:@"%@支付密码",title];
    }
    self.navigationItem.title = title;
}
- (IBAction)clickSubmit:(id)sender {
}
- (IBAction)clickSecret:(UIButton *)sender {
    sender.selected = !sender.selected;
    NSInteger index = sender.tag;
    UITextField *text = self.textFieldPass1;
    if (index==102) {
        text = self.textFieldPass2;
    }
    text.secureTextEntry = !sender.selected;
}


@end
